// See the Electron documentation for details on how to use preload scripts:
// https://www.electronjs.org/docs/latest/tutorial/process-model#preload-scripts
import { contextBridge, ipcRenderer } from 'electron'
contextBridge.exposeInMainWorld('electronApi', {
  startChat: data => {
    ipcRenderer.send('start-chat', data)
  },
  onUpdateMessage: callback => {
    ipcRenderer.on('update-message', (event, data) => {
      callback(data)
    })
  },
  copyImage: image => {
    return ipcRenderer.invoke('copy-image', image)
  }
})
